﻿using System;
using System.Collections.Generic;
using System.Linq;
using GPSTracker.API.DataModel;

namespace GPSTracker.API.Helper
{
    public class CommonDAL
    {
        public static bool AddErrorLog(ErrorLog newEl)
        {
            try
            {
                var context = new GpsDCDataContext(CommonFx.GetConStr());
                newEl.LogDttm = System.DateTime.Now;

                context.ErrorLogs.InsertOnSubmit(newEl);
                context.SubmitChanges();

                return true;
            }
            catch
            {
                return false;
            }
        }
    }
}
